package com.demo.config.rabbitMq;

import com.demo.mapper.DemoMapper;
import jakarta.annotation.Resource;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * -消费者
 */
@Component
public class MsgListener2 {

	@Resource
	private DemoMapper mapper;

	@RabbitListener(queues = "direct_queue")
	public void listener2(String content) {
		// 测试数据库插入数据操作
		// int insert = mapper.insert(Integer.valueOf(content));
		System.out.println("已完成短信发送业务（rabbitmq）2" + content);
	}

	@RabbitListener(queues = "topic_queue2")
	public void listener22(String content) {
		// 测试数据库插入数据操作
		// int insert = mapper.insert(Integer.valueOf(content));
		System.out.println("已完成短信发送业务（rabbitmq）2" + content);
	}

}
